package com.dxy.demo.controller;

import com.dxy.demo.config.AppConfig;
import com.dxy.demo.config.SuperConfig;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description 健康检测
 * @Author dangxianyue
 * @Date 2023/12/4 17:49
 */
@Slf4j
@AllArgsConstructor
@RestController
public class HealthController {

    private AppConfig appConfig;

    private SuperConfig.A a;

    @GetMapping("health")
    public Map health() {
        log.info("健康检查-health-" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        final HashMap<String, Object> map = new HashMap<>();
        map.put("code", 200);
        map.put("msg", "OK");
        map.put("data", appConfig);
        System.out.println(a);
        return map;
    }
}
